﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DAL.User
{
    interface IUserDao
    {

        /// <summary>
        /// 判断用户是否存在, 通过用户名
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>
        /// 返回User实体类，null则不存在
        /// </returns>
        Models.User QueryUserByUserName(string username);

        /// <summary>
        /// 判断用户是否存在，通过用户名和密码
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns>
        /// 返回User实体类，null则不存在
        /// </returns>
        Models.User QueryUserByUserNameAndPwd(string username, string pwd);

        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="user">用户实体类</param>
        /// <returns>用户信息实体类</returns>
        Models.UserInfo QueryUserInfo(Models.User user);

        Models.ResumeInfo QueryResumeInfo(Models.User user);

        List<Models.User> GetList(ref int totalCount, int pageIndex = 1, int pageSize = 12, string orderBy = "CreatedAt Desc");

        List<Models.User> GetList(ref int totalCount,string[] tags, int pageIndex = 1, int pageSize = 12, string orderBy = "CreatedAt Desc");

        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="user">用户实体类</param>
        void saveUser(Models.User user);

        /// <summary>
        /// 插入用户信息
        /// </summary>
        /// <param name="userInfo">用户信息实体类</param>
        void saveUserInfo(Models.UserInfo userInfo);

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="user">用户实体类</param>
        /// <returns>true为修改成功，反之失败</returns>
        bool updateUser(Models.User user);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userinfo">用户信息实体类</param>
        /// <returns>true为修改成功，反之失败</returns>
        bool updateUserInfo(Models.UserInfo userInfo);

        void saveResumeInfo(Models.ResumeInfo resumeInfo);

        bool updateResumeInfo(Models.ResumeInfo resumeInfo);

    }
}
